package net.gdface.cassdk;

import net.gdface.sdk.fse.BaseFeatureSearchEngine;
import net.gdface.sdk.fse.FeatureSe;
import net.gdface.utils.NativeUtils;

/**
 * 基于CASSDK Arm android算法的特征码内存搜索引擎(FSE,feature search engine)java接口类(JNI)
 * @author guyadong
 *
 */
public class FseWrapperBridge extends BaseFeatureSearchEngine{
	private static final String DEFAULT_LIB_NAME = "fse_cas_jni";

	private static final FeatureSe FSE_INSTANCE = new FeatureSeImpl(FseWrapperBridge.class.getName());
	static {
		try{
			NativeUtils.loadFromJar(DEFAULT_LIB_NAME);
			init();
			libraryLoaded = true;
		}catch(Exception e){
			throw new ExceptionInInitializerError(e);
		}
	}
	protected FseWrapperBridge() {
	}
	
	/**
	 * 返回FSE搜索引擎的单实例
	 * @return
	 */
	public static FeatureSe getFeatureSe(){
		return isLibraryLoaded() ? FSE_INSTANCE : null;
	}
}
